﻿using PCBase.UIControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisionCore
{
    public class ChipInfo
    {
        [Category("a.基本参数"), DisplayName("01.有效"), Description("fale：资料无效；true：资料有效；"), ReadOnly(true)]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool Enable { get; set; } = false;

        [Category("a.基本参数"), DisplayName("02.Wafer_ID"), Description("Wafer_ID")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string Wafer_ID { get; set; } = "";

        [Category("a.基本参数"), DisplayName("03.卡匣资料"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public CSTInfo CST { get; set; } = new CSTInfo();

        [Category("a.基本参数"), DisplayName("04.镭射内容"), Description("")]//20230203liang新增
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public LaserIniInfo laserIniInfo { get; set; } = new LaserIniInfo();

        [Category("b.Efem单元"), DisplayName("01.检测开始时间"), Description("")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public DateTime StartDT { get; set; } = DateTime.Now;

        [Category("b.Efem单元"), DisplayName("02.检测完成时间"), Description("")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public DateTime EndDT { get; set; } = DateTime.Now;

        [Category("b.Efem单元"), DisplayName("10.Efem Aligner标识"), Description("ON: 有Aligner; OFF：未Aligner")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool AlignerFlag { get; set; } = false;

        [Category("b.Efem单元"), DisplayName("11.Efem 扫码标识"), Description("ON: 有扫码; OFF：未扫码")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool BarReadFlag { get; set; } = false;


        //[Category("c.倒膜单元"), DisplayName("01.倒膜压力根据产品数量变化功能"), Description("启用：True, 使用每个颗粒倒膜压力(N / pcs);关闭：False, 使用倒膜压力设定")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ExcPressureByCountEnable { get; set; } = true;

        //[Category("c.倒膜单元"), DisplayName("02.倒膜比例阀压力(Mpa)"), Description("单位(Mpa)")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public double ExcPressureSetValu { get; set; } = 0;

        //[Category("c.倒膜单元"), DisplayName("03.倒膜压力计压力(N)"), Description("单位(N)")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public double ExcPressureMonitorValu { get; set; } = 0;

        //[Category("c.倒膜单元"), DisplayName("04.倒膜标识"), Description("ON: 倒膜完成; OFF：未倒膜")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ExchangedFlag { get; set; } = false;

        //[Category("c.倒膜单元"), DisplayName("05.倒膜平台Maping标识"), Description("ON: Maping完成; OFF：未Maping")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ExcPreAlignFlag { get; set; } = false;

        //[Category("c.倒膜单元"), DisplayName("06.倒膜平台Mapping数量"), Description("单位：颗")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public uint MappingTotalCount { get; set; } = 0;

        //[Category("c.倒膜单元"), DisplayName("07.倒膜平台读码标识"), Description("ON: 有扫码; OFF：未扫码")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool CodeReadFlag { get; set; } = false;

        //[Category("c.倒膜单元"), DisplayName("08.倒膜检测标识"), Description("ON: 检测完成; OFF：未检测")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ExcRetInspFlag { get; set; } = false;

        //[Category("c.倒膜单元"), DisplayName("09.倒膜检测结果"), Description("ON: 倒膜NG; OFF：倒膜OK")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ExcRet { get; set; } = false;

        //[Category("c.倒膜单元"), DisplayName("10.倒膜检测开始时间"), Description("")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public DateTime ExcInspStartDT { get; set; } = DateTime.Now;


        //[Category("c.挑拣单元"), DisplayName("01.挑拣完成标识"), Description("ON: 挑拣完成;OFF：挑拣未完成")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool SortCompletFlag { get; set; } = false;

        //[Category("c.挑拣单元"), DisplayName("02.Map读取标识"), Description("ON: 已读取;OFF：未读取")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool ReadMapFlag { get; set; } = false;

        //[Category("d.挑拣NG单元"), DisplayName("01.挑拣完成标识"), Description("ON: 挑拣完成;OFF：挑拣未完成")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool NGSortCompletFlag { get; set; } = false;

        //[Category("d.挑拣NG单元"), DisplayName("02.Map读取标识"), Description("ON: 已读取;OFF：未读取")]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public bool NGReadMapFlag { get; set; } = false;

        [Category("e.其他"), DisplayName("20.退出标识"), Description("搬回Port标识")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool UnloadFlag { get; set; } = false;
    }
    public class CSTInfo
    {
        [Category("基本参数"), DisplayName("01.卡匣名称"), Description("该片对应的卡匣名称")]
        [EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string Name { get; set; } = "";

        [Category("基本参数"), DisplayName("02.Lot Number"), Description("Lot Number")]
        [EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string LotNo { get; set; } = "";

        [Category("基本参数"), DisplayName("02.Lot Number"), Description("Lot Number")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public DeviceType Type { get; set; } =  DeviceType.Frame;

        [Category("基本参数"), DisplayName("05.位置层"), Description("该片对应的层位置")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public ushort Slot { get; set; } = 0;

        [Category("基本参数"), DisplayName("06.卡匣位置"), Description("该片对应的卡匣位置：PA;PB")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public CSTPos Pos { get; set; } = CSTPos.Other;

        public override string ToString()
        {
            return "...";
        }
        public enum CSTPos
        {
            PA,
            PB,
            Other
        }
    }

    public class LaserIniInfo
    {
        [DisplayName("01.InI文件读取标识"), Description("")]
        public bool IniFileReadFlag { get; set; } = false;


        [DisplayName("02.Content"), Browsable(true), ReadOnly(true)]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public Content IniContent { get; set; } = new Content();
        public override string ToString()
        {
            return "...";
        }

        public class Content
        {
            [DisplayName("01.X"), Description("")]
            public double X { get; set; } = 0;

            [DisplayName("02.Y"), Description("")]
            public double Y { get; set; } = 0;

            [DisplayName("03.Line1"), Description("")]
            public string Line1 { get; set; } = "";

            [DisplayName("04.Line2"), Description("")]
            public string Line2 { get; set; } = "";

            [DisplayName("05.Line3"), Description("")]
            public string Line3 { get; set; } = "";

            [DisplayName("06.Line4"), Description("")]
            public string Line4 { get; set; } = "";

            public override string ToString()
            {
                return "...";
            }
        }

    }
}
